package org.lmj.controller;

import org.lmj.annotation.DimAutoWried;
import org.lmj.annotation.DimController;
import org.lmj.annotation.DimRequestMapping;
import org.lmj.annotation.DimRequestParam;
import org.lmj.service.UserService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@DimController("uSERCONTROLLER")
@DimRequestMapping("user")
public class UserController {
    @DimAutoWried("userBeanNameTest")
    UserService userService;

    @DimRequestMapping("/say")
    public void say(HttpServletRequest request, HttpServletResponse response,
                      @DimRequestParam(value = "word") String word){

        String result=userService.say(word);
        try {
            response.getWriter().write(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
        // System.out.println(word);
    }
}
